package nbcp.db.mongo.entity

import nbcp.db.IdUrl
import nbcp.db.mongo.*
import org.springframework.data.mongodb.core.mapping.Document
import java.time.LocalDateTime


@Document
@MongoEntityGroup("admin")
data class AdminUser(
        var loginName: String = "",
        var name: String = "",
        var logo: IdUrl = IdUrl(), //头像.
        var mobile: String = "",

        var sex: UserSexEnum? = null,
        var qq: String = "",
        var token: String = "",    //验证用户使用.
        var createAt: LocalDateTime = LocalDateTime.now(),
        var updateAt: LocalDateTime = LocalDateTime.now()
) : IMongoDocument()

@Document
@MongoEntityGroup("admin")
data class AdminLoginUser(
        var loginName: String = "",
        var password: String = "",
        var lastLoginAt: LocalDateTime = LocalDateTime.now(),
        var errorLoginTimes: Byte = 0,
        var isLocked: Boolean = false,
        var lockedRemark: String = ""
) : IMongoDocument()



//@Document
//@MongoEntityGroup("admin")
//data class AdminDefinition(
//        //        //权限定义
////        var permissions: MutableList<String> = mutableListOf(),
//        //菜单定义
//        var menus: MutableList<MenuDefine> = mutableListOf()
//): IMongoDocument()